import logging
import os
import time
from multiprocessing import Pool

import yaml

num = 0

def task(name):
    print(f'thread name : {name} , pid : {os.pid}')
    logging.info('thread name : {name} , pid : {os.pid}')
    time.sleep(0.1)
    global num
    num +=1

if __name__ == '__main__':

    p = Pool(10)
    for i in range(20):
        name = 'name' + str(i)
        p.apply_async(task, args=(name, ))


    print(f' num = {num}')
    time.sleep(5)